package com.service;

import com.annotion.Lock;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Service;

@Service
public class TimeTask {

    @Value("${server.port}")
    private  String port;

    @Scheduled(cron = "0/10 * * * * ?")
    @Lock(name = "happy")
    public  void sendHappy()
    {
        System.out.println(port+"生快:"+new java.util.Date().toLocaleString());
    }

}
